package lanqiao;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;

public class 砝码称重 {

    public static void main(String[] args) {
        HashSet<Integer> set = new HashSet<>();
        Scanner scanner =new Scanner(System.in);
       int n = scanner.nextInt();
       int[] fama = new int[n];

        for (int i = 0; i < n; i++) {
            fama[i] = scanner.nextInt();
        }
        set.add(0);
        for (int i = 0; i < n; i++) {
            //set集合转化为list集合
            List<Integer> list = new ArrayList<>(set);
            for (int k:list) {
                set.add(k+fama[i]);
                set.add(Math.abs(k-fama[i]));
            }
        }
        set.remove((Object)0);
        System.out.println(set.size());
        scanner.close();
    }
}